﻿using System.Collections.ObjectModel;
using ApartmentBillsManager.Start.Common;

namespace ApartmentBillsManager.Start.Services
{
    public static class ObjectsFactory
    {
        private static readonly CreateEditApartment CreateEditApartment;
        private static readonly CreateEditRoommate CreateEditRoommate;
        private static readonly CreateEditBill CreateEditBill;

        static ObjectsFactory()
        {
            CreateEditApartment = new CreateEditApartment();
            CreateEditRoommate = new CreateEditRoommate();
            CreateEditBill = new CreateEditBill();
        }

        public static Apartment CreateNewApartment()
        {
            return CreateEditApartment.CreateNewApartment();
        }

        public static Apartment EditExistingApartment(Apartment apartment)
        {
            return CreateEditApartment.EditExistingApartment(apartment);
        }

        public static Roommate CreateNewRoommate()
        {
            return CreateEditRoommate.CreateNewRoommate();
        }

        public static Roommate EditExistingRoomate(Roommate roommate)
        {
            return CreateEditRoommate.EditExitingRoommate(roommate);
        }

        public static Bill CreateNewBill(ObservableCollection<Roommate> roommates)
        {
             return CreateEditBill.CreateNewBill(roommates);
        }

        public static Bill EditExistingBill(Bill bill, ObservableCollection<Roommate> roommates)
        {
            return CreateEditBill.EditExistingBill(bill, roommates);
        }
    }
}
